package com.qidian.mes.wm.service.impl;

import com.qidian.mes.wm.mapper.WareAreaMapper;
import com.qidian.mes.wm.service.WareAreaService;
import com.qidian.mes.wm.vo.WareAreaVO;
import com.qidian.mes.util.pojo.QdResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author: 小可怎么都睡不够
 * @Description:
 * @Time: 2024-04-13 14:21
 **/
@Service
public class WareAreaServiceImpl implements WareAreaService {
    @Autowired
    private WareAreaMapper wareAreaMapper;

    @Override
    public QdResult add(WareAreaVO wareAreaVO) {
        wareAreaMapper.add(wareAreaVO);
        return QdResult.success();
    }

    @Override
    public QdResult update(WareAreaVO wareAreaVO) {
        wareAreaMapper.update(wareAreaVO);
        return QdResult.success();

    }

    @Override
    public QdResult delete(Integer wareAreaId) {
        wareAreaMapper.delete(wareAreaId);
        return QdResult.success();

    }

    @Override
    public QdResult query(Integer wareId, String wareAreaName, Integer page, Integer limit) {
        return QdResult.success(wareAreaMapper.query(wareId,wareAreaName, (page - 1) * limit, limit));
    }

    @Override
    public QdResult getCount(Integer wareId) {
        return QdResult.success(wareAreaMapper.getCount(wareId));
    }
}
